package vm.machine;

public class LoadInstruction extends AbstractInstruction {

    String register;
    int value;
    public LoadInstruction(Machine machine,String register, int value){
        super(machine);
        this.register = register;
        this.value = value;
    }

    @Override
    public void doAction() {
        Register reg = machine.getRegister(register);
        reg.setValue(this.value);
    }

    @Override
    public String toString() {
        return "执行Load指令";
    }
}
